#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
    int i, s;
    FILE *fp;
    if ((fp = fopen("/home/wangsong/vscode/Devdoc/f1.txt", "w")) == NULL)
    {
        printf("open error");
        exit(0);
    }
    for (s = 1997; s < 3000; s++)
    {
        if ((s % 4 == 0 && s % 100 != 0) || s % 400 == 0)
        {
            fprintf(fp, "%d   \t", s);
        }
    }
    if (fclose(fp))
    {
        printf("close error!");
        exit(0);
    }
    return 0;
}